package clientApp;

import game.map.Static;

/**
 *
 * @author Gabriel
 */
@SuppressWarnings("serial")
public class PartyPanel extends javax.swing.JPanel {

	public int id;
	public int currentHP;
	public String charName;
	private int color;
	
    /** Creates new form PartyPanel */
    public PartyPanel(int id, String name, int hp) {
    	this.id = id;
    	this.charName = name;
    	this.currentHP = hp;
    	this.color = Static.WHITE;
        initComponents();
    }
    
    public PartyPanel(int id, String name, int hp, int color) {
    	this.id = id;
    	this.charName = name;
    	this.currentHP = hp;
    	this.color = color;
        initComponents();
    }

    private void initComponents() {

        jLabelCharName = new javax.swing.JLabel();
        jLabelTotalHP = new javax.swing.JLabel();
        jLabelHP = new javax.swing.JLabel();
        jLabelCurrentHP = new javax.swing.JLabel();

        setBackground(new java.awt.Color(0, 0, 102));
        setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Member", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14), new java.awt.Color(255, 255, 255))); // NOI18N
        setPreferredSize(new java.awt.Dimension(168, 100));

        jLabelCharName.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelCharName.setForeground(new java.awt.Color(color));
        jLabelCharName.setText(charName);

        jLabelTotalHP.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelTotalHP.setForeground(new java.awt.Color(255, 255, 255));
        jLabelTotalHP.setText("| "+currentHP);

        jLabelHP.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelHP.setForeground(new java.awt.Color(255, 255, 255));
        jLabelHP.setText("HP:");

        jLabelCurrentHP.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelCurrentHP.setForeground(new java.awt.Color(255, 255, 255));
        jLabelCurrentHP.setText(""+currentHP);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelCharName)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabelHP)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabelCurrentHP)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabelTotalHP)))
                .addContainerGap(56, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelCharName)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelHP)
                    .addComponent(jLabelCurrentHP)
                    .addComponent(jLabelTotalHP))
                .addContainerGap(22, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabelCharName;
    private javax.swing.JLabel jLabelCurrentHP;
    private javax.swing.JLabel jLabelHP;
    private javax.swing.JLabel jLabelTotalHP;
    // End of variables declaration//GEN-END:variables
}
